// 图片模型
export interface ImageModel {
  id: number
  name: string
  originalName: string
  fileUrl: string
  fileSize: number
  mimeType: string
  width: number
  height: number
  description?: string
  aiRecognitionStatus: 'PENDING' | 'SUCCESS' | 'FAILED'
  tags: string[]
  createdAt: string
  updatedAt: string
  usageCount: number
  textContentCount?: number
  generatedImageCount?: number
  relevanceScore?: number
  highlights?: string[]
}

// 文案内容模型
export interface TextContentModel {
  id: number
  imageId: number
  content: string
  contentType: 'SHORT' | 'LONG'
  styleType: 'PROMOTIONAL' | 'WARM' | 'PROFESSIONAL'
  aiGenerationStatus: 'PENDING' | 'SUCCESS' | 'FAILED'
  createdAt: string
  updatedAt: string
}

// 标签模型
export interface TagModel {
  id: number
  name: string
  category: string
  usageCount: number
  createdAt: string
  updatedAt: string
}

// 生成图片记录模型
export interface GeneratedImageModel {
  id: number
  originalImageId: number
  generatedImageId?: number
  generatedImageUrl?: string
  generationPrompt?: string
  generationParams?: string
  aiGenerationStatus: 'PENDING' | 'SUCCESS' | 'FAILED'
  similarityScore?: number
  createdAt: string
  updatedAt: string
}

// API响应基础结构
export interface ApiResponse<T = any> {
  success: boolean
  message: string
  timestamp: number
  data?: T
}

// 分页响应结构
export interface PaginatedResponse<T = any> extends ApiResponse<T[]> {
  pagination: {
    currentPage: number
    totalPages: number
    totalElements: number
    size: number
    hasNext: boolean
    hasPrevious: boolean
  }
}

// 搜索条件
export interface SearchCriteria {
  keyword?: string
  tags?: string[]
  mimeTypes?: string[]
  minWidth?: number
  maxWidth?: number
  minHeight?: number
  maxHeight?: number
  minFileSize?: number
  maxFileSize?: number
  startDate?: string
  endDate?: string
  aiStatus?: 'SUCCESS' | 'PENDING' | 'FAILED'
  page?: number
  size?: number
  sortBy?: string
  sortDir?: string
}

// 搜索建议
export interface SearchSuggestion {
  text: string
  type: 'tag' | 'image'
  usageCount: number
}

// 标签云项目
export interface TagCloudItem {
  tagName: string
  usageCount: number
  weight: number
}

// 文件上传进度
export interface UploadProgress {
  file: File
  progress: number
  status: 'pending' | 'uploading' | 'success' | 'error'
  response?: ImageModel
  error?: string
}

// 文案生成请求
export interface TextGenerationRequest {
  imageId: number
  contentType: 'SHORT' | 'LONG'
  styleType: 'PROMOTIONAL' | 'WARM' | 'PROFESSIONAL'
  customPrompt?: string
}

// 图片生成请求
export interface ImageGenerationRequest {
  originalImageId: number
  count: number
  style: 'auto' | 'product' | 'lifestyle' | 'artistic' | 'minimalist'
  customPrompt?: string
}

// 批量图片生成请求
export interface BatchImageGenerationRequest {
  imageIds: number[]
  countPerImage: number
  style: 'auto' | 'product' | 'lifestyle' | 'artistic' | 'minimalist'
  customPrompt?: string
}

// 用户偏好设置
export interface UserPreferences {
  theme: 'light' | 'dark' | 'auto'
  language: 'zh-CN' | 'en-US'
  pageSize: number
  defaultSortBy: string
  defaultSortDir: 'asc' | 'desc'
  autoSave: boolean
  showTutorial: boolean
}

// 应用状态
export interface AppState {
  loading: boolean
  selectedImages: ImageModel[]
  searchKeyword: string
  selectedTags: string[]
  currentView: 'grid' | 'list'
  sidebarCollapsed: boolean
}

// 统计信息
export interface Statistics {
  totalImages: number
  totalSize: number
  formattedSize: string
  jpegCount: number
  pngCount: number
  gifCount: number
  webpCount: number
  popularTags: Array<{
    tagName: string
    usageCount: number
  }>
  recentUploads: number
  aiRecognitionSuccess: number
  textGenerationSuccess: number
  imageGenerationSuccess: number
}